package com.neuedu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neuedu.model.Product;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ProductDao extends BaseMapper<Product> {

    //商品信息管理-添加
    void save(Product product);
    // 减少库存
    int reduceStock(Integer pid, Integer quantity);

    // 查询商品库存
    Integer getStockById(Integer pid);


}
